<template>
  <section v-if="name === 'smsSwitchDesc'">
    {{ smsSwitchDesc ? smsSwitchDesc : "--" }}
  </section>
  <section v-else-if="name === 'voiceSwitchDesc'">
    {{ voiceSwitchDesc ? voiceSwitchDesc : "--" }}
  </section>
  <section v-else-if="name === 'certPushSwitchDesc'">
    {{ certPushSwitchDesc ? certPushSwitchDesc : "--" }}
  </section>
  <section v-else-if="name === 'deliveryTimeDesc'">
    <div v-if="deliveryTimeDesc">
      <span v-for="(item,index) in isDeliveryTimeDesc"
          :key="index">
      <el-tag size="medium"
              style="margin-right:5px">{{ item }}</el-tag>
      </span>
    </div>
    <div v-else>--</div>
  </section>
  <section v-else>--</section>
</template>

<script>
export default {
  name: "BooleanEscape",
  props: {
    row: {
      type: Object,
      default: () => { }
    },
    name: String
  },
  computed: {
    smsSwitchDesc () {
      return this.row.config?.smsSwitchDesc
    },
    voiceSwitchDesc () {
      return this.row.config?.voiceSwitchDesc
    },
    certPushSwitchDesc () {
      return this.row.config?.certPushSwitchDesc
    },
    isDeliveryTimeDesc () {
      return this.row.config?.deliveryTimeDesc?.split(',')
    },
    deliveryTimeDesc () {
      return this.row.config?.deliveryTimeDesc
    }
  }
};
</script>
